package com.xxxx.server.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 返回公共对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RespBean {
    public  int code;
    public String message;
    public  Object object;

    /**
     *成功返回结果
     * @param message
     * @return
     */
    public  static RespBean success(String message)
    {
        return  new RespBean(200,message,null);
    }

    public  static RespBean success(String message, Object object)
    {
        return  new RespBean(200,message,object );

    }

    /**
     * 失败返回结果
     * @param message
     * @return
     */
    public  static RespBean error(String message)
    {
        return  new RespBean(500,message,null);
    }

    public  static RespBean error(String message, Object object)
    {
        return  new RespBean(500,message,object );

    }
}
